package com.dfbz.demo03_拷贝案例;

import java.io.FileReader;
import java.io.FileWriter;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_字符流拷贝文本 {
    public static void main(String[] args) throws Exception{

        FileReader reader = new FileReader("001.txt");
        FileWriter writer = new FileWriter("csb.txt");

        char[] data = new char[2];

        int len;

        while ((len = reader.read(data))!=-1){
            writer.write(data,0,len);
        }

        writer.close();
        reader.close();
    }
}
